package interview.huawei.tjt.training.huaweijishitiku;

import java.util.Scanner;

// 字符串字符匹配
public class HJ81 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        while ( sc.hasNextLine() ) {
            String str1 = sc.nextLine();
            String str2 = sc.nextLine();
            boolean flag = false;
            int count = 0;
            for ( int i = 0; i < str1.length(); i ++ ) {
                for ( int j = 0; j < str2.length(); j ++ ) {
                    if ( str2.charAt(j) == str1.charAt(i) ) {
                        count ++;
                        break;
                    }
                }
            }
            if ( count == str1.length() ) {
                flag = true;
            }
            System.out.println(flag);
        }

    }

}
